﻿package client;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JTable;
import javax.swing.JLabel;
import javax.swing.JButton;

import java.awt.Dialog.ModalityType;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;


public class ComLoadGUI extends JDialog {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	/*public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ComLoadGUI frame = new ComLoadGUI();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
*/
	/**
	 * Create the frame.
	 */
	public ComLoadGUI() {
		
		setTitle("Welcome to Community");
		setModalityType(ModalityType.APPLICATION_MODAL);
		setBounds(100, 100, 450, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnNewButton = new JButton("\u5C45\u4F4F\u533A");;
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();

				ComComeinGUI ccg = new ComComeinGUI();
				ccg.setLocationRelativeTo(null);
				ccg.setVisible(true);

			}
		});
		btnNewButton.setContentAreaFilled(false);
	    btnNewButton.setBorder(null);
		btnNewButton.setBounds(27, 21, 110, 40);
		contentPane.add(btnNewButton);
		
		JButton button = new JButton("\u552E\u623F\u533A");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
				ComHouseInforGUI chg = new ComHouseInforGUI();
				chg.setLocationRelativeTo(null);
				chg.setVisible(true);

			}
		});
		button.setContentAreaFilled(false);
	    button.setBorder(null);
		button.setBounds(169, 21, 110, 40);
		contentPane.add(button);
		
		JButton button_1 = new JButton("\u7269\u4E1A");
		button_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
				ComPropertyGUI cpg = new ComPropertyGUI();
				cpg.setLocationRelativeTo(null);
				cpg.setVisible(true);

			}
		});
		button_1.setContentAreaFilled(false);
	    button_1.setBorder(null);
		button_1.setBounds(307, 21, 98, 40);
		contentPane.add(button_1);
		
		JButton button_2 = new JButton("离开社区");
		button_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				dispose();
			}
		});
		//button_2.setContentAreaFilled(false);
	    //button_2.setBorder(null);
		button_2.setBounds(344, 221, 80, 31);
		contentPane.add(button_2);
		
		JLabel lblNewLabel = new JLabel(new ImageIcon("src/client/images/q.jpg"));
		lblNewLabel.setBounds(-19, -39, 503, 336);
		contentPane.add(lblNewLabel);
	}
}
